<!DOCTYPE>
<html>
<head>
	<title></title>
	<meta charset="utf-8"/>
	<script>
		window.onload=function(){
			getNewContent();
		};
		function getHttpObject(){
				/*if(typeof XMLHttpRequest=="undefined"){
					XMLHttpRequest=function(){
						try{
							return new ActiveXObject("Msxml2.XMLHTTP.6.0");
						}catch(e){}
						try{
							return new ActiveXObject("Msxml2.XMLHTTP.3.0");
						}catch(e){}
						try{
							return new ActiveXObject("Msxml2.XMLHTTP");
						}catch(e){}
						return false;
					};
				}
				return new XMLHttpRequest();*/
				var request;
				if(window.XMLHttpRequest){
					request=new XMLHttpRequest()'
				}else{
					request=new ActiveXObject("Microsoft.XMLHTTP");
				}
				return request;
			}
		function getNewContent(){
			var request=getHttpObject();
			if(request){
				request.open("GET","sample.txt",true);
				request.onreadystatechange=function(){
					//alert(request.readyState);
					if(request.readyState==4){
						var para=document.createElement("p");
						var text=document.createTextNode(request.responseText);
						para.appendChild(text);
						document.getElementById("new").appendChild(para);
					}
				};
				request.send(null);	
			}else{
				alert("sorry");
			}
			
		}
	</script>
</head>
<body>
	<div id="new"></div>
</body>
</html>